package cn.com.zhangwoo.microstar.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import cn.com.microstar.activity.R;
import cn.com.zhangwoo.microstar.entity.CityUser;
/**
 * 城市Adapter
 * @author 张切
 *
 */
public class ListCityAdapter extends BaseAdapter {
	private List<CityUser .Data>  listDate;
	Context context;
	LayoutInflater inflater;
	public ListCityAdapter(List<CityUser .Data>  listDate,Context context) {
		this.listDate=listDate;
		this.inflater=LayoutInflater.from(context);
	}
    @Override
    public int getCount() {
       return listDate.size();
    }

    @Override
    public Object getItem(int position) {
        return listDate.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (null == convertView) {
            convertView =inflater.inflate(R.layout.city_list1_item, null);
            holder = new ViewHolder();
            holder.name = (TextView) convertView.findViewById(R.id.city_list_city_name);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        	holder.name.setText(listDate.get(position).getName());
       // imageLoder.loadImage(listDate.get(position).getChannelimage(), holder.image, true);
     
        
        // ImageLoader.getInstance().displayImage(, holder.image, mDisplayImageOptions);
        return convertView;
    }
    
    class ViewHolder {
        ImageView image;
        TextView name;
    }

}
